<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function addText(){
				let df = document.createDocumentFragment()
				for (var i = 0; i < 10; i++) {
					let text = document.createElement("div")
					text.innerHTML = "我爱薇薇安！！！"
					df.appendChild(text)
				}	
				document.querySelector(".con").appendChild(df)
				
			}
			function addImg(){
				let df1 = document.createDocumentFragment()
				for (var i = 0; i < 10; i++) {
					let img = document.createElement("img")
					img.setAttribute("src","../src/ok.png") 
					df1.appendChild(img)
				}	
				document.querySelector(".con").appendChild(df1)
				
			}
		</script>
	</head>
	<body>
		<button onclick="addText()">添加十个文字</button>
		<button onclick="addImg()">添加十个图片</button>
		<div class="con"></div>
	</body>
</html>
